package com.bw.controller;


import com.bw.domain.SysUser;
import com.bw.service.SysUserService;

import com.bw.utils.common.Result;
import com.bw.vo.UserVO;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author bobo棒
 * @date 2023年10月24日 11:28
 */

@RequestMapping("user")
@RestController
public class UserController {
    @Autowired
    SysUserService sysUserService;

    @RequestMapping("list")
    public Result list(@RequestBody  UserVO userVO, @RequestParam(defaultValue = "1") Integer current, @RequestParam(defaultValue = "3") Integer pageSize){
        PageHelper.startPage(current,pageSize);
        List<SysUser> list = sysUserService.listUser(userVO);
        PageInfo<SysUser> info = new PageInfo<>(list);
        return Result.success(info);


    }
}
